package study.spring.core.ioc._2_inject_bean;

import lombok.Data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Bean;

/**
 * 用于演示 @Bean 注解在方法上, 如何运行, 这里是对象, 被 @Bean 注解的方法在 {@link BeanConfig#beanExample()}
 */
@Data
public class AtBeanAnnotationBean {

  protected final Log log = LogFactory.getLog(getClass());

  private String field;

  public AtBeanAnnotationBean() {
    log.info("执行 AtBeanAnnotationBean 的 无参构造器方法");
  }

  public String printSomeThing() {
    String s = "hello";
    log.info(s);
    return s;
  }
}
